<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        {:build_heading(null,FALSE)}
        <ul class="nav nav-tabs">
            <li class="active"><a href="#add" data-toggle="tab">{:__('添加销售单')}</a></li>
        </ul>
    </div>
    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="add">
                <div class="widget-body no-padding">
                    <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="control-label col-xs-12 col-sm-3">{:__('Manufacturer')}:</label>
                                    <div class="col-xs-12 col-sm-8">
                                        <input id="c-manufacturer_id" data-rule="required" data-source="manufacturer/index" class="form-control selectpage" name="row[manufacturer_id]" type="text" value="">
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="control-label col-xs-12 col-sm-3">{:__('Customer')}:</label>
                                    <div class="col-xs-12 col-sm-8">
                                        <input id="c-customer_id" data-rule="required" data-source="customer/index" class="form-control selectpage" name="row[customer_id]" type="text" value="">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <div class="form-group">
                                    <label class="control-label col-xs-12 col-sm-2">{:__('商品明细')}:</label>
                                    <div class="col-xs-12 col-sm-9">
                                        <div class="table-responsive">
                                            <table class="table table-striped">
                                                <thead>
                                                    <tr>
                                                        <th>{:__('Product')}</th>
                                                        <th>{:__('Unit_price')}</th>
                                                        <th>{:__('Quantity')}</th>
                                                        <th>{:__('Jin_per_bag')}</th>
                                                        <th>{:__('Bags_per_piece')}</th>
                                                        <th>{:__('Purchase_price')}</th>
                                                        <th>{:__('Subtotal')}</th>
                                                        <th>{:__('操作')}</th>
                                                    </tr>
                                                </thead>
                                                <tbody id="item-list">
                                                    <tr id="item-template" class="item-row">
                                                        <td>
                                                            <input class="form-control selectpage product-select" data-rule="required" data-source="product/index" name="items[__index__][product_id]" type="text" value="">
                                                        </td>
                                                        <td><input class="form-control item-unit-price" name="items[__index__][unit_price]" type="number" value="0" step="0.01"></td>
                                                        <td><input class="form-control item-quantity" name="items[__index__][quantity]" type="number" value="1" min="1"></td>
                                                        <td><input class="form-control item-jin-per-bag" name="items[__index__][jin_per_bag]" type="number" value="0" step="0.01"></td>
                                                        <td><input class="form-control item-bags-per-piece" name="items[__index__][bags_per_piece]" type="number" value="0" step="0.01"></td>
                                                        <td><input class="form-control item-purchase-price" name="items[__index__][purchase_price]" type="number" value="0" step="0.01"></td>
                                                        <td class="item-subtotal">0.00</td>
                                                        <td><a href="javascript:;" class="btn btn-xs btn-danger btn-remove-item"><i class="fa fa-trash"></i></a></td>
                                                    </tr>
                                                </tbody>
                                                <tfoot>
                                                    <tr>
                                                        <td colspan="8">
                                                            <a href="javascript:;" class="btn btn-success btn-add-item"><i class="fa fa-plus"></i> {:__('添加商品')}</a>
                                                        </td>
                                                    </tr>
                                                </tfoot>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="control-label col-xs-12 col-sm-3">{:__('Order_date')}:</label>
                                    <div class="col-xs-12 col-sm-8">
                                        <input id="c-order_date" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[order_date]" type="text" value="{:date('Y-m-d H:i:s')}">
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="control-label col-xs-12 col-sm-3">{:__('Discount_amount')}:</label>
                                    <div class="col-xs-12 col-sm-8">
                                        <input id="c-discount_amount" class="form-control" name="row[discount_amount]" type="number" value="0" step="0.01">
                                    </div>
                                </div>
                            </div>
                            
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="control-label col-xs-12 col-sm-3">{:__('Total_weight')}:</label>
                                    <div class="col-xs-12 col-sm-8">
                                        <input id="c-total_weight" class="form-control" name="row[total_weight]" type="number" value="0" step="0.01" readonly>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-xs-12 col-sm-3">{:__('Total_amount')}:</label>
                                    <div class="col-xs-12 col-sm-8">
                                        <input id="c-total_amount" class="form-control" name="row[total_amount]" type="number" value="0" step="0.01" readonly>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-xs-12 col-sm-3">{:__('Total_purchase_price')}:</label>
                                    <div class="col-xs-12 col-sm-8">
                                        <input id="c-total_purchase_price" class="form-control" name="row[total_purchase_price]" type="number" value="0" step="0.01" readonly>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-xs-12 col-sm-3">{:__('Customer_payment')}:</label>
                                    <div class="col-xs-12 col-sm-8">
                                        <input id="c-customer_payment" class="form-control" name="row[customer_payment]" type="number" value="0" step="0.01">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-xs-12 col-sm-3">{:__('Manufacturer_payment')}:</label>
                                    <div class="col-xs-12 col-sm-8">
                                        <input id="c-manufacturer_payment" class="form-control" name="row[manufacturer_payment]" type="number" value="0" step="0.01">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-xs-12 col-sm-3">{:__('Notes')}:</label>
                                    <div class="col-xs-12 col-sm-8">
                                        <textarea id="c-notes" class="form-control" name="row[notes]" rows="2"></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="form-group layer-footer">
                            <label class="control-label col-xs-12 col-sm-2"></label>
                            <div class="col-xs-12 col-sm-8">
                                <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
                                <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div> 